///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __VERTEXBUFFER_H__
#define __VERTEXBUFFER_H__

#include <Config.h>
#include <vector>

//-----------------------------------------------------------------------------

enum	eVertexDataType
{
	eVDT_POSITION,
	eVDT_COLOR,
	eVDT_NORMAL,
	eVDT_TEXCOORD,

	//Milkshape specific
	eVDT_BONE_ID,
};

enum	eVertexComponentType
{
	eVCT_FLOAT,
	eVCT_DOUBLE,
	eVCT_SHORT,
	eVCT_INTEGER,
};

//-----------------------------------------------------------------------------

typedef struct sVertexInfo
{
	eVertexDataType			type;
	eVertexComponentType	componentType;
	u8						sizeComponent;
	u8						noComponents;
	u8						offset;
} VertexInfo;

//-----------------------------------------------------------------------------

class VertexBuffer
{
public:
	/*	Constructor. */
						VertexBuffer();

	/*	Destructor. */
	virtual				~VertexBuffer();

	void				AddComponent(
		eVertexDataType			type,
		eVertexComponentType	componentType,
		u8						sizeComponent,
		u8						noComponents
		);
	std::vector<VertexInfo>&
						GetComponents()
	{
		return m_contents;
	}

	void				ReleaseData();
	void				InitData(u32 noComponents);

	u32					GetNoComponents()
	{
		return m_noComponents;
	}

	u8					GetComponentSize();

	void*				GetDataPtr()
	{
		return m_dataPtr;
	}

private:

	std::vector<VertexInfo>		m_contents;

	u32							m_noComponents;
	u8							m_componentSize;

	void*						m_dataPtr;
};

#endif // __VERTEXBUFFER_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
